package com.study.talk.module.entity.vo;

import com.study.talk.module.netty.message.request.CreateGroupRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class GroupInfoVo {
    @ApiModelProperty("群聊名称")
    @NotEmpty(message = "群聊名称不能为空")
    private String name;

    @ApiModelProperty("群聊头像地址")
    @NotEmpty(message = "群聊头像地址不能为空")
    private String avatar;

    @ApiModelProperty("群聊背景图片")
    private String bgImg;

    @ApiModelProperty("群聊标签")
    @NotEmpty(message = "群聊标签不能为空")
    private String tag;

    @ApiModelProperty("群聊介绍")
    @NotEmpty(message = "群聊介绍不能为空")
    private String introduce;

    @ApiModelProperty("群主id")
    @NotEmpty(message = "群主id不能为空")
    private Integer mainUser;

    public GroupInfoVo(CreateGroupRequest createGroupRequest) {
        this.name = createGroupRequest.getGroupName();
        this.avatar = createGroupRequest.getAvatar();
        this.bgImg = createGroupRequest.getBgImg();
        this.tag = createGroupRequest.getTag();
        this.introduce = createGroupRequest.getIntroduce();
        this.mainUser = createGroupRequest.getMainUser();
    }
}
